﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DataServer.SalaryCalculation
{
    public class MonthBasedCalculation : CalculationStrategy
    {
        private int _soThanNhan;
        private int _luongCB = 3500000;

        public int LuongCB
        {
            get { return _luongCB; }
            set { _luongCB = value; }
        }
        private double _heSo = 1.25;

        public double HeSo
        {
            get { return _heSo; }
            set { _heSo = value; }
        }

        private double _heSoThanNhan = 0.05;

        public double HeSoThanNhan
        {
            get { return _heSoThanNhan; }
            set { _heSoThanNhan = value; }
        }

        public MonthBasedCalculation(int soThanNhan)
        {
            _soThanNhan = soThanNhan;
        }

        public override int computeSalary()
        {
            double dLuong = _luongCB * _heSo;
            dLuong += _heSoThanNhan * _soThanNhan * _luongCB;
            int luong = Convert.ToInt32(dLuong);

            return luong;
        }
    }
}